package com.zksb.controller;

import com.zksb.entity.Department;
import com.zksb.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/depart")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/{id:\\d+}")
    @ResponseBody
    public Object get(@PathVariable("id") Integer id) {
        Department department = departmentService.get(id);
        return department;
    }

}
